package com.vehicle_information_management_system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.vehicle_information_management_system.dto.TripDto;
import com.vehicle_information_management_system.dto.VehicleCount;
import com.vehicle_information_management_system.dto.VehicleDto;
import com.vehicle_information_management_system.dto.VehicleWithDriver;
import com.vehicle_information_management_system.pojo.VehicleInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author huawei
* @description 针对表【vehicle_info】的数据库操作Mapper
* @createDate 2025-02-16 16:00:52
* @Entity com.vehicle_information_management_system.pojo.VehicleInfo
*/
public interface VehicleInfoMapper extends BaseMapper<VehicleInfo> {

    IPage<VehicleInfo> getVehicleInfoWithDriver(IPage<VehicleInfo> page,@Param("ew") QueryWrapper<VehicleInfo> queryWrapper);

    void updateVehicleInfo(VehicleInfo vehicleInfo);

    List<VehicleDto> getVehicleInfo();

    //获取各个部门的车辆数
    List<VehicleCount> getVehicleInfoByDepartment();

    //根据车辆id获取驾驶员
    VehicleWithDriver getDriverByVehicle(Integer vehicleId);

    //获取各个生产厂家的车辆数
    List<VehicleCount> selectVehicleCountByManufacturer(QueryWrapper<VehicleCount> queryWrapper);

    //获取使用状态的车辆数
    Integer getUseStatusVehicleCount();

    //获取未使用的车辆信息
    List<VehicleDto> getNoUseVehicleInfo();

    void updateUseStatus(Integer vehicleId,Integer useStatus);

    void batchUpdateUseStatus(List<Integer> vehicleIds);
}




